package cn.psvmc.cxzapi.config;

import org.springframework.beans.factory.annotation.Value;

/**
 * @Author ywx
 * @Classname ConfigKey
 * @Description 读取配置文件类
 * @Date 2020/10/16 9:19
 **/
//@Component
public class ConfigKey {

    /***********信审*******/
    //公司id
    public static String companyId;
    //查询接口地址
    public static String url;
    //对称加密Key
    public static String aesKey;

    @Value("${xs.companyId}")
    public void setCompanyId(String companyId) {
        ConfigKey.companyId = companyId;
    }

    @Value("${xs.url}")
    public void setUrl(String url) {
        ConfigKey.url = url;
    }

    @Value("${xs.aesKey}")
    public void setAesKey(String aesKey) {
        ConfigKey.aesKey = aesKey;
    }

    /***********阿里云oss*******/
    public static String ossAccessKeyId;
    public static String ossAccessKeySecret;
    public static String ossEndpoint;
    public static String bucketName;
    public static String endpoint2;
    public static String bucketName2;
    public static String previewUrl;

    @Value("${oss.accessKeyId}")
    public void setOssAccessKeyId(String ossAccessKeyId) {
        ConfigKey.ossAccessKeyId = ossAccessKeyId;
    }

    @Value("${oss.accessKeySecret}")
    public void setOssAccessKeySecret(String ossAccessKeySecret) {
        ConfigKey.ossAccessKeySecret = ossAccessKeySecret;
    }

    @Value("${oss.endpoint}")
    public void setOssEndpoint(String ossEndpoint) {
        ConfigKey.ossEndpoint = ossEndpoint;
    }

    @Value("${oss.bucketName}")
    public void setBucketName(String bucketName) {
        ConfigKey.bucketName = bucketName;
    }

    @Value("${oss.endpoint2}")
    public void setEndpoint2(String endpoint2) {
        ConfigKey.endpoint2 = endpoint2;
    }

    @Value("${oss.bucketName2}")
    public void setBucketName2(String bucketName2) {
        ConfigKey.bucketName2 = bucketName2;
    }

    @Value("${oss.previewUrl}")
    public void setPreviewUrl(String previewUrl) {
        ConfigKey.previewUrl = previewUrl;
    }

    /***********阿里云短信*******/
    public static String accessKeyId;
    public static String accessKeySecret;
    public static String templateCode;
    public static String signName;

    @Value("${dx.accessKeyId}")
    public void setAccessKeyId(String accessKeyId) {
        ConfigKey.accessKeyId = accessKeyId;
    }

    @Value("${dx.accessKeySecret}")
    public void setAccessKeySecret(String accessKeySecret) {
        ConfigKey.accessKeySecret = accessKeySecret;
    }

    @Value("${dx.templateCode}")
    public void setTemplateCode(String templateCode) {
        ConfigKey.templateCode = templateCode;
    }

    @Value("${dx.signName}")
    public void setSignName(String signName) {
        ConfigKey.signName = signName;
    }

    /***********云通讯短信*******/
    //平台秘钥Key
    public static String ytAppkey;
    //平台秘钥
    public static String ytAppSecret;
    // 模版编号
    public static String ytTemplateId;
    //短信签名名称
    public static String ytSignName;
    //服务请求路径
    public static String ytUrl;

    @Value("${yt.appkey}")
    public void setYtAppkey(String ytAppkey) {
        ConfigKey.ytAppkey = ytAppkey;
    }

    @Value("${yt.appsecret}")
    public void setYtAppSecret(String ytAppSecret) {
        ConfigKey.ytAppSecret = ytAppSecret;
    }

    @Value("${yt.templateId}")
    public void setYtTemplateId(String ytTemplateId) {
        ConfigKey.ytTemplateId = ytTemplateId;
    }

    @Value("${yt.signName}")
    public void setYtSignName(String ytSignName) {
        ConfigKey.ytSignName = ytSignName;
    }

    @Value("${yt.url}")
    public void setYtUrl(String ytUrl) {
        ConfigKey.ytUrl = ytUrl;
    }

    /***********阿里云sts*******/
    public static String stsAccessKeyId;
    public static String stsAccessKeySecret;
    public static String stsEndpoint;
    public static String arn;
    public static String sessionName;

    @Value("${sts.accessKeyId}")
    public void setStsAccessKeyId(String stsAccessKeyId) {
        ConfigKey.stsAccessKeyId = stsAccessKeyId;
    }

    @Value("${sts.accessKeySecret}")
    public void setStsAccessKeySecret(String stsAccessKeySecret) {
        ConfigKey.stsAccessKeySecret = stsAccessKeySecret;
    }

    @Value("${sts.endpoint}")
    public void setStsEndpoint(String stsEndpoint) {
        ConfigKey.stsEndpoint = stsEndpoint;
    }

    @Value("${sts.arn}")
    public void setArn(String arn) {
        ConfigKey.arn = arn;
    }

    @Value("${sts.sessionName}")
    public void setSessionName(String sessionName) {
        ConfigKey.sessionName = sessionName;
    }

    /***********支付宝*******/
    //支付宝服务调用地址
    public static String serverUrl;
    //信用服务ID，信用预授权场景必传
    public static String serviceId;
    //评估方案ID
    public static String riskSchemeId;
    //小程序应用名称
    public static String appName;
    //小程序应用编号
    public static String appId;
    //应用私钥
    public static String privateKey;
    //签名验证密钥
    public static String signVeriKey;
    //签名解密密钥
    public static String decryptKey;
    //支付宝证书路径
    public static String certPath;
    //支付宝应用公钥证书名称
    public static String appCertName;
    //支付宝服务回调地址
    public static String notifyUrl;

    @Value("${zfb.signVeriKey}")
    public void setSignVeriKey(String signVeriKey) {
        ConfigKey.signVeriKey = signVeriKey;
    }

    @Value("${zfb.decryptKey}")
    public void setDecryptKey(String decryptKey) {
        ConfigKey.decryptKey = decryptKey;
    }

    @Value("${zfb.certPath}")
    public void setCertPath(String certPath) {
        ConfigKey.certPath = certPath;
    }

    @Value("${zfb.appCertName}")
    public void setAppCertName(String appCertName) {
        ConfigKey.appCertName = appCertName;
    }

    @Value("${zfb.serviceId}")
    public void setServiceId(String serviceId) {
        ConfigKey.serviceId = serviceId;
    }

    @Value("${zfb.notifyUrl}")
    public void setNotifyUrl(String notifyUrl) {
        ConfigKey.notifyUrl = notifyUrl;
    }

    @Value("${zfb.riskSchemeId}")
    public void setRiskSchemeId(String riskSchemeId) {
        ConfigKey.riskSchemeId = riskSchemeId;
    }

    @Value("${zfb.serverUrl}")
    public void setServerUrl(String serverUrl) {
        ConfigKey.serverUrl = serverUrl;
    }

    @Value("${zfb.appName}")
    public void setAppName(String appName) {
        ConfigKey.appName = appName;
    }

    @Value("${zfb.appId}")
    public void setAppId(String appId) {
        ConfigKey.appId = appId;
    }

    @Value("${zfb.privateKey}")
    public void setPrivateKey(String privateKey) {
        ConfigKey.privateKey = privateKey;
    }

    /***********顺丰快递*******/
    //顾客编码
    public static String partnerID;
    //校验码
    public static String md5Key;
    //环境地址
    public static String callUrl;

    @Value("${sf.partnerID}")
    public void setPartnerID(String partnerID) {
        this.partnerID = partnerID;
    }

    @Value("${sf.md5Key}")
    public void setMd5Key(String md5Key) {
        this.md5Key = md5Key;
    }

    @Value("${sf.callUrl}")
    public void setCallUrl(String callUrl) {
        this.callUrl = callUrl;
    }

    /***********德邦快递*******/
    //公司编码
    public static String companyCode;
    //应用key
    public static String appkey;
    //请求路径
    public static String requestUrl;
    //签名Key
    public static String signKey;
    //查询订单
    public static String queryOrder;
    //新标准轨迹查询
    public static String newTraceQuery;
    //标准轨迹订阅接口
    public static String standTraceSubscribe;
    //【新】下单服务接口
    public static String createOrderNotify;
    //是否订阅轨迹接口
    public static boolean enableSubscribe;

    @Value("${db.enableSubscribe}")
    public void setEnableSubscribe(boolean enableSubscribe) {
        ConfigKey.enableSubscribe = enableSubscribe;
    }

    @Value("${db.queryOrder}")
    public void setQueryOrder(String queryOrder) {
        ConfigKey.queryOrder = queryOrder;
    }

    @Value("${db.newTraceQuery}")
    public void setNewTraceQuery(String newTraceQuery) {
        ConfigKey.newTraceQuery = newTraceQuery;
    }

    @Value("${db.standTraceSubscribe}")
    public void setStandTraceSubscribe(String standTraceSubscribe) {
        ConfigKey.standTraceSubscribe = standTraceSubscribe;
    }

    @Value("${db.createOrderNotify}")
    public void setCreateOrderNotify(String createOrderNotify) {
        ConfigKey.createOrderNotify = createOrderNotify;
    }

    @Value("${db.signKey}")
    public void setSignKey(String signKey) {
        ConfigKey.signKey = signKey;
    }

    @Value("${db.companyCode}")
    public void setCompanyCode(String companyCode) {
        ConfigKey.companyCode = companyCode;
    }

    @Value("${db.appkey}")
    public void setAppkey(String appkey) {
        ConfigKey.appkey = appkey;
    }

    @Value("${db.requestUrl}")
    public void setRequestUrl(String requestUrl) {
        ConfigKey.requestUrl = requestUrl;
    }

    /***********e签宝*******/
    //应用ID
    public static String eAppId;
    //应用秘钥
    public static String eAppSecret;
    //服务请求地址
    public static String eHostUrl;
    //签名回调地址
    public static String eRedirectUrl;
    //是否启用e签宝
    public static Boolean enabled;
    //平台法人代表
    public static String platformName;
    //公章编号
    public static String sealId;
    //模板ID
    public static String docTemplateId;
    //企业ID
    public static String orgId;
    //签署区位置
    public static String signFieldPosition;

    @Value("${eqb.appId}")
    public void seteAppId(String eAppId) {
        ConfigKey.eAppId = eAppId;
    }

    @Value("${eqb.appSecret}")
    public void seteAppSecret(String eAppSecret) {
        ConfigKey.eAppSecret = eAppSecret;
    }

    @Value("${eqb.hostUrl}")
    public void seteHostUrl(String eHostUrl) {
        ConfigKey.eHostUrl = eHostUrl;
    }

    @Value("${eqb.redirectUrl}")
    public void seteRedirectUrl(String eRedirectUrl) {
        ConfigKey.eRedirectUrl = eRedirectUrl;
    }

//    @Value("${eqb.enabled}")
    public void setEnabled(Boolean enabled) {
        ConfigKey.enabled = enabled;
    }

    @Value("${eqb.platformName}")
    public void setPlatformName(String platformName) {
        ConfigKey.platformName = platformName;
    }

    @Value("${eqb.sealId}")
    public void setSealId(String sealId) {
        ConfigKey.sealId = sealId;
    }

    @Value("${eqb.docTemplateId}")
    public void setDocTemplateId(String docTemplateId) {
        ConfigKey.docTemplateId = docTemplateId;
    }

    @Value("${eqb.orgId}")
    public void setOrgId(String orgId) {
        ConfigKey.orgId = orgId;
    }

    @Value("${eqb.signFieldPosition}")
    public void setSignFieldPosition(String signFieldPosition) {
        ConfigKey.signFieldPosition = signFieldPosition;
    }

    /***********授权书html地址*******/
    public static String topdfpath;//wkhtmltopdf安装路径
    public static String htmlpath;//html路径
    public static String pdfpath;//pdf路径

    @Value("${sys.topdfpath}")
    public void setTopdfpath(String topdfpath) {
        ConfigKey.topdfpath = topdfpath;
    }

    @Value("${sys.htmlpath}")
    public void setHtmlpath(String htmlpath) {
        ConfigKey.htmlpath = htmlpath;
    }

    @Value("${sys.pdfpath}")
    public void setPdfpath(String pdfpath) {
        ConfigKey.pdfpath = pdfpath;
    }

    /***********系统基础配置*******/
    //缓存访问数据有效时长
    public static Integer redisdatatime;
    //secretKey必须为24位
    public static String secretKey;

    @Value("${sys.redisdatatime}")
    public void setRedisdatatime(Integer redisdatatime) {
        ConfigKey.redisdatatime = redisdatatime;
    }

    @Value("${sys.secretKey}")
    public void setSecretKey(String secretKey) {
        ConfigKey.secretKey = secretKey;
    }

    //是否开启测试模式
    public static boolean enableTest;

    @Value("${sys.enable-test}")
    public void setEnableTest(boolean enableTest) {
        ConfigKey.enableTest = enableTest;
    }
}
